App<IAppOption>({
  onLaunch() {
    // 维护登陆状态
    wx.checkSession({
      success: () => {},
      fail: () => { wx.login({}); }
    });

    // 设备
    // const getSystemInfoSync = wx.getSystemInfoSync();
    // console.log(getSystemInfoSync);
    // this.globalData.platform = getSystemInfoSync.platform;

    // 缓存处理
    const token = wx.getStorageSync('token') || '';
    const userInfo = wx.getStorageSync('userInfo') || null;
    const account = wx.getStorageSync('account') || null;
    const identify = wx.getStorageSync('identify') || null;

    // 没办法直接登录了
    // if (token === '' || userInfo === '' || account === '') {
    //   this.goLoginView();
    // }

    // 用户信息
    this.globalData.token = token;
    this.globalData.userInfo = userInfo;
    this.globalData.account = account;
    this.globalData.identify = identify;
  },
  globalData: {
    userInfo: null as any,
    account: null,
    identify: null as any,
    token: '' as any,
    platform: '',
    loginView: false,
  }
});